<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <title>添加点标记</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <style>
        body,
        html,
        #container {
            overflow: hidden;
            width: 100%;
            height: 100%;
            margin: 0;
            font-family: "微软雅黑";
        }
    </style>
    <script src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=gktwARGFRZcfumx9y9vml1vntQI6cCoO"></script>
</head>

<body>
    <div id="container"></div>
</body>

</html>
<script>
    //创建地图的对象,
    var map = new BMapGL.Map('container');//113.854457,22.60646
    //设置中心点,地图的放大缩小比例
    var point = new BMapGL.Point(113.854457, 22.60646);
    map.centerAndZoom(point, 15);
    // 可以滚轮手动缩放
    map.enableScrollWheelZoom(true);
    // 创建点标记
    var marker = new BMapGL.Marker(point);

    // 在地图上添加点标记
    map.addOverlay(marker);
    // 将标注添加到地图中
    var opts = {
        width: 200,     // 信息窗口宽度
        height: 100,     // 信息窗口高度
        title: "它石web前端 宝安校区", // 信息窗口标题
        message: "这里是前端的大课堂"
    }
    var infoWindow = new BMapGL.InfoWindow("地址：宝安校区新中泰大厦", opts);  // 创建信息窗口对象 
    marker.addEventListener("click", function () {
        map.openInfoWindow(infoWindow, point); //开启信息窗口
    });

</script>